/*=============================================================================
*
*   Copyright (C) 2020 All rights reserved.
*
*   Filename:		test_point.cpp
*
*   Author: Wang Zhecheng - wangzhecheng@yeah.net
*
*   Date: 2020-02-23 11:45
*
*   Last Editors: Wang Zhecheng - wangzhecheng@yeah.net
*
*   Last modified:	2020-08-31 04:53
*
*   Description:
*
=============================================================================*/
#include "../include/geometry/shape/point.hpp"
#include <iostream>
#include <memory>
#include <unordered_set>
#include <vector>

using geoxfem::geometry::Point2D;

int main() {
  Point2D p1(0.0f, 0.0f, 0, 0), p2(4.0f, 3.0f, 0, 1), p3(0.0f, 3.0f, 0, 2),
    p4(4.0f, 0.0f, 0, 3), p5(0.0f, 5.0f, 0, 4), p6(0.0f, -1.5f, 0, 5),
    p7(4.0f, 4.5f, 0, 6);

  std::vector<Point2D> v1;
  std::cout << "111111111" << std::endl;
  v1.emplace_back(p6.shallowClone());
  std::cout << "111111112" << std::endl;
  v1.emplace_back(p7.shallowClone());
  std::cout << "111111113" << std::endl;
  Segment<int, Point2D, 1> seg1(v1);
  std::cout << seg1 << std::endl;
  std::cout << "666666666" << std::endl;
  v1.clear();
  v1.emplace_back(p1.shallowClone());
  v1.emplace_back(p3.shallowClone());
  v1.emplace_back(p2.shallowClone());
  v1.emplace_back(p4.shallowClone());
  std::cout << "777777777" << std::endl;
  Quadrangle<int, Point2D, 1> poly1(v1);
  std::vector<Point2D>             res;
  std::cout << seg1 << std::endl;
  std::cout << poly1 << std::endl;
  std::cout << "888888888" << std::endl;
  boost::geometry::intersection(poly1, seg1, res);
  std::cout << "999999999" << std::endl;
  for(auto& p : res)
    std::cout << p << std::endl;
  std::cout << "000000000" << std::endl;

  return 0;
}
